import Api from './request'

// 发布动态接口
export const postDynamicApi = (data) => Api.post("/api/dynamic", data)

// 删除动态接口
export const deleteDynamicApi = (data => Api.del("/api/dynamic/" + data.id))

// 获取全部动态
export const getAllDynamicApi = (data) => Api.get("/api/dynamic", data)
// 获取自己的全部动态
export const getAllDynamicMyApi = (data) => Api.get("/api/dynamic/my", data)

// 获取关注列表的动态
export const getAllUserListDynamicApi = (data) => Api.get("/api/dynamic/user/list", data)

// 获取动态详情
export const getDynamycByIdApi = (data) => Api.get(`/api/dynamic/${data.id}`)

// 获取一级评论接口
export const getDynamycCommentApi = (data) => Api.get(`/api/dynamic/comment/${data.dynamycId}`, data)

// 获取二级评论接口
export const getDynamycCommentReplyApi = (data) => Api.get(`/api/dynamic/comment/reply/${data.commentId}`)

// 添加评论接口
export const postDynamycCommentApi = (data) => Api.post('/api/dynamic/comment', data)

// 点赞接口
export const postDynamycLike = (data) => Api.post(`/api/dynamic/like/${data.id}`)

// 收藏接口
export const postDynamycCollect = (data) => Api.post(`/api/dynamic/collect/${data.id}`)

// 获取用户收藏的动态
export const getDynamycCollectAll = (data) => Api.get("/api/dynamic/collect/all", data)

// 动态举报
export const postReportApi = (data) => Api.post("/api/dynamic/report", data)

// 切换动态是否显示状态
export const postSwitchApi = (data) => Api.post("/api/dynamic/switch/" + data.id)